﻿import com.dinmax.labonline.*

class UIAcordion {
	private var _parente:MovieClip;
	private var _listener:Object;
		
	function UIAcordion(){
	}
	
	public function crear(parent:MovieClip):MovieClip{
		_parente=parent;
		_parente.createObject("Accordion", "cacMenu", _parente.getNextHighestDepth());
		_parente.cacMenu.setStyle("themeColor", "0x555599");
		_parente.cacMenu.move(510,90);
		_parente.cacMenu.setSize(175, 200);
		_listener=new Object();
		_listener.change=function (e:Object){
			if(e.target.selectedChild.label==" Pedidos"){
				Application.getMenuPedido().borrarPedidos();
				Application.getMenuPedido().refreshPedidos();
			}
		}
		_parente.cacMenu.addEventListener("change", _listener);
		
		return _parente.cacMenu;
	}
	public function addSegmento(linkage:String, clip:String, _label:String, linkIcono:String):MovieClip{
		_parente.cacMenu.createSegment(linkage, clip, _label, linkIcono);
		return _parente.cacMenu[clip];
	}
		
	
} // FIN